# -*- coding: utf-8 -*-

class TTaskInfo(dict):
    def __init__(self):
        dict.__init__(self)

    def asDict(self):
        data = {
            "id": self["id"],
            "state": self["state"],
        }
        return data

    def createFromDict(self, dictData):
        self["id"] = dictData["id"]
        self["state"] = dictData["state"]
        return self

class TASK_INFO:
    def __init__(self):
        pass

    def createObjFromDict(self, dict):
        return TTaskInfo().createFromDict(dict)

    def getDictFromObj(self, obj):
        return obj.asDict()

    def isSameType(self, obj):
        return isinstance(obj, TTaskInfo)

task_info_inst = TASK_INFO()